import http from "./http";

// 获取今日新闻信息 & 轮播图信息
// const queryNewsLatest = () => http.get('/jian/trending/now');
// const queryNewsLatest = () => http.get('/zhi/news/latest');
// // 获取往日新闻信息
// const queryNewsBefore = (time) => http.get('/api/news_before', { params: time })
// // 获取新闻详细信息
// const queryNewsInfo = (id) => http.get('/api/news_info', { params: { id } });
// // 获取新闻点赞信息
// const queryStoryExtra = (id) => http.get('/api/story_extra', { params: { id } });
// //  头部数据 轮播图
// const newsLatest = (id) => http.get('/zhi/news/latest');

const queryMovieList = ({ page_limit, page_start }) => http.get('/douban/j/search_subjects', {
    params: {   page_limit, page_start,  type: 'movie', tag: '热门'}
});


// https://m.douban.com/rexxar/api/v2/movie/35056376?ck=&for_mobile=1
// https://m.douban.com/rexxar/api/v2/niffler/columns/261?for_mobile=1
// https://m.douban.com/rexxar/api/v2/niffler/modules?for_mobile=1
// https://news-at.zhihu.com/api/4/news/3892357  富文本编辑器

// 电影详情写死 mock.js
const getMovieDetail = ({ id, url }) => http.get(`http://127.0.0.1:3000/https://${url}`)

// 首页点击第一个固定写死为书本详情---富文本
// const getBookDetail = ({ id, url }) => http.get('http://127.0.0.1:3000/https://booDetailkUrl')


const loginPost = (body) => http.post(`http://127.0.0.1:3000/https://loginPost` ,body )

const registerPost = (body) => http.post(`http://127.0.0.1:3000/https://registerPost` ,body )


/* 暴露API */
const api = {
    queryMovieList,
    getMovieDetail,
    loginPost,
    registerPost
}

export default api;